{if="$user['level_name']=='officer'"}
<form action = "standard-add.php" method = "post">
{/if}
{if="$user['level_name']=='assessor'"}
<form action = "standard-update.php" method = "post" enctype='multipart/form-data'>
{/if}
<input type = "hidden" name = "id" value = "{$assessment['id']}">
<table class = "list">
	<tr>
		<th class = "w20">ข้อ</th>
		{if="$user['level_name'] == 'officer'"}
		<th class = "w150">เกณฑ์มาตรฐาน</th>
		<th class = "w150">ผลการดำเนินงาน</th>
		<th class = "w100">หลักฐาน</th>
		<th class = "w30">ลบ</th>
		{else}
		<th class = "w180">เกณฑ์มาตรฐาน</th>
		<th class = "w180">ผลการดำเนินงาน</th>
		<th class = "w100">หลักฐาน</th>
		{/if}
	</tr>
	{loop="standard"}
	<tr>
		<td>{$key+1}.)</td>
		{if="$user['level_name']=='officer'"}
			<td><textarea name = "standard[{$value.id}]" class = "col3">{$value.name}</textarea></td>
		{else}
			<td>{$value.name}</td>
		{/if}
		{if="$user['level_name']=='assessor'"}
			<td><textarea name = "name[{$value.id}]" class = "col3">{$value.result}</textarea></td>
			<td>
				<? $i = 0; ?>
				{loop="upload"}
					{if="$value2.acid == $value1.id"}
					<? $i++; ?>
					<a href = "{$value2.upload}" target = "_blank"><img src="images/filetype_icons/{$value2.icon}" class = "h20"> หลักฐาน {$i}
					</a>
					<a href = "delete-file.php?id={$value2.id}&ref={$assessment[id]}"><img src="images/icon/delete.png" title = "ลบไฟล์"></a>
					<br>
					{/if}
				{/loop}
				<input type = "file" name = "upload{$value.id}" class = "w70" size="2">
			</td>
		{else}
			<td>{$value.result}</td>
			<td>{$value.related}</td>
			{if="$user['level_name'] == 'officer'"}
			<td><a href = "standard-delete.php?id={$value.id}&aid={$id}" alt = "ลบ" title = "ลบ" class = "delete"><img src="images/icon/delete.png"></a></td>
			{/if}
		{/if}
	</tr>
	{/loop}
	{if="$user['level_name']=='officer'"}
	<tr>
		<td></td>
		<td><textarea name = "name"></textarea></td>
		<td></td>
		<td></td>
		<td></td>
	</tr>
	{/if}
</table>

{if="$user['level_name']=='officer'"}
	<input type = "submit" value = "ตกลง">
{/if}